//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Resource Application Block
//===============================================================================

using Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation;
using Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.Configuration;

namespace EntLibContrib.Resource.Instrumentation
{
	/// <summary>
	/// This type supports the Enterprise Library infrastructure and is not intended to be used directly from your code.
	/// Represents the process to build a <see cref="DefaultResourceEventLogger"/> according to instrumentation configuration.
	/// </summary>
	public class DefaultResourceEventLoggerCustomFactory : DefaultEventLoggerCustomFactoryBase
	{
		#region Protected Methods
		/// <summary>
		/// This method supports the Enterprise Library infrastructure and is not intended to be used directly from your code.
		/// Builds a <see cref="DefaultResourceEventLogger"/>.
		/// </summary>
		/// <param name="instrumentationConfigurationSection">The instrumentation section that is used as configuration.</param>
		/// <returns>A fully initialized instance of <see cref="DefaultResourceEventLogger"/>.</returns>
		protected override object DoCreateObject(InstrumentationConfigurationSection instrumentationConfigurationSection)
		{
			return new DefaultResourceEventLogger(instrumentationConfigurationSection.EventLoggingEnabled, instrumentationConfigurationSection.WmiEnabled);
		}
		#endregion
	}
}